
function keyLogin(){
    if (event.keyCode==13)  //回车键的键值为13
        document.getElementById("confirm").click(); //调用登录按钮的登录事件
}
function changePassword(){
    var password=document.getElementById("password").value;
    var name=document.getElementById("username").value;
    var email=document.getElementById("email").value;
    ajaxCall("POST",path+"/BoolServlet?method=changePassword&password="+password+"&name="+name+"&email="+email,changePassword1);
}
function changePassword1(response){
    var obj=JSON.parse(response);
    if("success"==obj){
        alert("修改成功");
        window.location.href = path+"/login.jsp";
    }
    if("exist"==obj){
        alert("用户已存在，请重新修改!");
        window.location.href = path+"/jsp/change.jsp";
    }

}
function checkPwd(){
    var password1=document.getElementById("password").value;
    var confirmPassword=document.getElementById("confirmPassword").value;
    if(password1!=confirmPassword){
        alert("用户名或者密码错误");
        window.location.href = path+"/jsp/change.jsp";
    }else{
        changePassword();
    }
}

